package com.example.Servlet;

        import javax.servlet.*;
        import javax.servlet.http.*;
        import javax.servlet.annotation.*;
        import java.io.IOException;

@WebServlet(name = "GetSrcServlet", value = "/GetSrcServlet")
public class GetSrcServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // 设置响应内容类型
        response.setContentType("text/html;charset=UTF-8");
        // 获取当前时间
        String currentTime = java.time.LocalTime.now().toString();
        // 将当前时间作为响应内容返回
        response.getWriter().write(currentTime);
    }
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request, response);
    }
}